Integrand size = 23, antiderivative size = 91 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {b (d f-e g) n x}{2 e}-\frac {b n (g+f x)^2}{4 f}-\frac {b (d f-e g)^2 n \log (d+e x)}{2 e^2 f}+\frac {(g+f x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f} \]
1/2*b*(d*f-e*g)*n*x/e-1/4*b*n*(f*x+g)^2/f-1/2*b*(d*f-e*g)^2*n*ln(e*x+d)/e^ 2/f+1/2*(f*x+g)^2*(a+b*ln(c*(e*x+d)^n))/f
Time = 0.04 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.04 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=a g x-b g n x+\frac {1}{2} a f x^2-\frac {1}{2} b f n \left (-\frac {d x}{e}+\frac {x^2}{2}+\frac {d^2 \log (d+e x)}{e^2}\right )+\frac {1}{2} b f x^2 \log \left (c (d+e x)^n\right )+\frac {b g (d+e x) \log \left (c (d+e x)^n\right )}{e} \]
a*g*x - b*g*n*x + (a*f*x^2)/2 - (b*f*n*(-((d*x)/e) + x^2/2 + (d^2*Log[d + e*x])/e^2))/2 + (b*f*x^2*Log[c*(d + e*x)^n])/2 + (b*g*(d + e*x)*Log[c*(d + e*x)^n])/e
Time = 0.26 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.98, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2005, 2842, 49, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x \left (f+\frac {g}{x}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx\) |
\(\Big \downarrow \) 2005 |
\(\displaystyle \int (f x+g) \left (a+b \log \left (c (d+e x)^n\right )\right )dx\) |
\(\Big \downarrow \) 2842 |
\(\displaystyle \frac {(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {b e n \int \frac {(g+f x)^2}{d+e x}dx}{2 f}\) |
\(\Big \downarrow \) 49 |
\(\displaystyle \frac {(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {b e n \int \left (\frac {(e g-d f)^2}{e^2 (d+e x)}+\frac {f (e g-d f)}{e^2}+\frac {f (g+f x)}{e}\right )dx}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {(f x+g)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 f}-\frac {b e n \left (\frac {(d f-e g)^2 \log (d+e x)}{e^3}-\frac {f x (d f-e g)}{e^2}+\frac {(f x+g)^2}{2 e}\right )}{2 f}\) |
-1/2*(b*e*n*(-((f*(d*f - e*g)*x)/e^2) + (g + f*x)^2/(2*e) + ((d*f - e*g)^2 *Log[d + e*x])/e^3))/f + ((g + f*x)^2*(a + b*Log[c*(d + e*x)^n]))/(2*f)
3.4.3.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int [ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && IGtQ[m, 0] && IGtQ[m + n + 2, 0]
Int[(Fx_)*(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[x^(m + n*p)*(b + a/x^n)^p*Fx, x] /; FreeQ[{a, b, m, n}, x] && IntegerQ[p] && Neg Q[n]
Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_ ))^(q_.), x_Symbol] :> Simp[(f + g*x)^(q + 1)*((a + b*Log[c*(d + e*x)^n])/( g*(q + 1))), x] - Simp[b*e*(n/(g*(q + 1))) Int[(f + g*x)^(q + 1)/(d + e*x ), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]
Time = 0.34 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.08
method | result | size |
parts | \(a \left (\frac {1}{2} f \,x^{2}+g x \right )+b \left (g \ln \left (c \left (e x +d \right )^{n}\right ) x -g n x +\frac {g n d \ln \left (e x +d \right )}{e}+\frac {f \,x^{2} \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )}{2}-\frac {f n \,x^{2}}{4}-\frac {n \,d^{2} f \ln \left (e x +d \right )}{2 e^{2}}+\frac {d f n x}{2 e}\right )\) | \(98\) |
default | \(a g x +\frac {a f \,x^{2}}{2}+b g \ln \left (c \left (e x +d \right )^{n}\right ) x -b g n x +\frac {b g n d \ln \left (e x +d \right )}{e}+\frac {b f \,x^{2} \ln \left (c \,{\mathrm e}^{n \ln \left (e x +d \right )}\right )}{2}-\frac {n b f \,x^{2}}{4}-\frac {n b \,d^{2} f \ln \left (e x +d \right )}{2 e^{2}}+\frac {b d f n x}{2 e}\) | \(101\) |
parallelrisch | \(-\frac {-2 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b \,e^{2} f +b \,e^{2} f n \,x^{2}+2 \ln \left (e x +d \right ) b \,d^{2} f n -8 \ln \left (e x +d \right ) b d e g n -2 a \,e^{2} f \,x^{2}-4 x \ln \left (c \left (e x +d \right )^{n}\right ) b \,e^{2} g -2 b d e f n x +4 b \,e^{2} g n x -4 a \,e^{2} g x +4 \ln \left (c \left (e x +d \right )^{n}\right ) b d e g +2 d^{2} b f n -4 b d e g n +4 a d e g}{4 e^{2}}\) | \(154\) |
risch | \(\frac {b x \left (f x +2 g \right ) \ln \left (\left (e x +d \right )^{n}\right )}{2}-\frac {i \pi b f \,x^{2} \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{4}+\frac {i \pi b f \,x^{2} \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}+\frac {i \pi b g x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}-\frac {i \pi b g x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{2}-\frac {i \pi b f \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )}{4}-\frac {i \pi b g x \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{3}}{2}+\frac {i \pi b f \,x^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{4}+\frac {i \pi b g x \,\operatorname {csgn}\left (i \left (e x +d \right )^{n}\right ) \operatorname {csgn}\left (i c \left (e x +d \right )^{n}\right )^{2}}{2}+\frac {\ln \left (c \right ) b f \,x^{2}}{2}-\frac {n b f \,x^{2}}{4}-\frac {n b \,d^{2} f \ln \left (e x +d \right )}{2 e^{2}}+\frac {b g n d \ln \left (e x +d \right )}{e}+\ln \left (c \right ) b g x +\frac {a f \,x^{2}}{2}+\frac {b d f n x}{2 e}-b g n x +a g x\) | \(338\) |
a*(1/2*f*x^2+g*x)+b*(g*ln(c*(e*x+d)^n)*x-g*n*x+g/e*n*d*ln(e*x+d)+1/2*f*x^2 *ln(c*exp(n*ln(e*x+d)))-1/4*f*n*x^2-1/2*n*d^2*f/e^2*ln(e*x+d)+1/2*d*f*n/e* x)
Time = 0.30 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.29 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-\frac {{\left (b e^{2} f n - 2 \, a e^{2} f\right )} x^{2} - 2 \, {\left (2 \, a e^{2} g + {\left (b d e f - 2 \, b e^{2} g\right )} n\right )} x - 2 \, {\left (b e^{2} f n x^{2} + 2 \, b e^{2} g n x - {\left (b d^{2} f - 2 \, b d e g\right )} n\right )} \log \left (e x + d\right ) - 2 \, {\left (b e^{2} f x^{2} + 2 \, b e^{2} g x\right )} \log \left (c\right )}{4 \, e^{2}} \]
-1/4*((b*e^2*f*n - 2*a*e^2*f)*x^2 - 2*(2*a*e^2*g + (b*d*e*f - 2*b*e^2*g)*n )*x - 2*(b*e^2*f*n*x^2 + 2*b*e^2*g*n*x - (b*d^2*f - 2*b*d*e*g)*n)*log(e*x + d) - 2*(b*e^2*f*x^2 + 2*b*e^2*g*x)*log(c))/e^2
Time = 0.64 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.47 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\begin {cases} \frac {a f x^{2}}{2} + a g x - \frac {b d^{2} f \log {\left (c \left (d + e x\right )^{n} \right )}}{2 e^{2}} + \frac {b d f n x}{2 e} + \frac {b d g \log {\left (c \left (d + e x\right )^{n} \right )}}{e} - \frac {b f n x^{2}}{4} + \frac {b f x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{2} - b g n x + b g x \log {\left (c \left (d + e x\right )^{n} \right )} & \text {for}\: e \neq 0 \\\left (a + b \log {\left (c d^{n} \right )}\right ) \left (\frac {f x^{2}}{2} + g x\right ) & \text {otherwise} \end {cases} \]
Piecewise((a*f*x**2/2 + a*g*x - b*d**2*f*log(c*(d + e*x)**n)/(2*e**2) + b* d*f*n*x/(2*e) + b*d*g*log(c*(d + e*x)**n)/e - b*f*n*x**2/4 + b*f*x**2*log( c*(d + e*x)**n)/2 - b*g*n*x + b*g*x*log(c*(d + e*x)**n), Ne(e, 0)), ((a + b*log(c*d**n))*(f*x**2/2 + g*x), True))
Time = 0.20 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.12 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=-b e g n {\left (\frac {x}{e} - \frac {d \log \left (e x + d\right )}{e^{2}}\right )} - \frac {1}{4} \, b e f n {\left (\frac {2 \, d^{2} \log \left (e x + d\right )}{e^{3}} + \frac {e x^{2} - 2 \, d x}{e^{2}}\right )} + \frac {1}{2} \, b f x^{2} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {1}{2} \, a f x^{2} + b g x \log \left ({\left (e x + d\right )}^{n} c\right ) + a g x \]
-b*e*g*n*(x/e - d*log(e*x + d)/e^2) - 1/4*b*e*f*n*(2*d^2*log(e*x + d)/e^3 + (e*x^2 - 2*d*x)/e^2) + 1/2*b*f*x^2*log((e*x + d)^n*c) + 1/2*a*f*x^2 + b* g*x*log((e*x + d)^n*c) + a*g*x
Leaf count of result is larger than twice the leaf count of optimal. 183 vs. \(2 (83) = 166\).
Time = 0.30 (sec) , antiderivative size = 183, normalized size of antiderivative = 2.01 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {{\left (e x + d\right )}^{2} b f n \log \left (e x + d\right )}{2 \, e^{2}} - \frac {{\left (e x + d\right )} b d f n \log \left (e x + d\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g n \log \left (e x + d\right )}{e} - \frac {{\left (e x + d\right )}^{2} b f n}{4 \, e^{2}} + \frac {{\left (e x + d\right )} b d f n}{e^{2}} - \frac {{\left (e x + d\right )} b g n}{e} + \frac {{\left (e x + d\right )}^{2} b f \log \left (c\right )}{2 \, e^{2}} - \frac {{\left (e x + d\right )} b d f \log \left (c\right )}{e^{2}} + \frac {{\left (e x + d\right )} b g \log \left (c\right )}{e} + \frac {{\left (e x + d\right )}^{2} a f}{2 \, e^{2}} - \frac {{\left (e x + d\right )} a d f}{e^{2}} + \frac {{\left (e x + d\right )} a g}{e} \]
1/2*(e*x + d)^2*b*f*n*log(e*x + d)/e^2 - (e*x + d)*b*d*f*n*log(e*x + d)/e^ 2 + (e*x + d)*b*g*n*log(e*x + d)/e - 1/4*(e*x + d)^2*b*f*n/e^2 + (e*x + d) *b*d*f*n/e^2 - (e*x + d)*b*g*n/e + 1/2*(e*x + d)^2*b*f*log(c)/e^2 - (e*x + d)*b*d*f*log(c)/e^2 + (e*x + d)*b*g*log(c)/e + 1/2*(e*x + d)^2*a*f/e^2 - (e*x + d)*a*d*f/e^2 + (e*x + d)*a*g/e
Time = 1.28 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.14 \[ \int \left (f+\frac {g}{x}\right ) x \left (a+b \log \left (c (d+e x)^n\right )\right ) \, dx=x\,\left (\frac {2\,a\,d\,f+2\,a\,e\,g-2\,b\,e\,g\,n}{2\,e}-\frac {d\,f\,\left (2\,a-b\,n\right )}{2\,e}\right )+\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {b\,f\,x^2}{2}+b\,g\,x\right )-\frac {\ln \left (d+e\,x\right )\,\left (b\,d^2\,f\,n-2\,b\,d\,e\,g\,n\right )}{2\,e^2}+\frac {f\,x^2\,\left (2\,a-b\,n\right )}{4} \]